Cannot convert to string [on hold]
Posted
by
user3598883
on Stack Overflow
See other posts from Stack Overflow
or by user3598883
Published on 2014-06-12T21:02:01Z
Indexed on
2014/06/12
21:25 UTC
Read the original article
Hit count: 150
c#
I am trying to transfer information from form1 to form2 and I am getting the error of "Cannot implicitly convert type form1.employee to 'string'
Some coding i have used for this transfer process is as follows: (everything is set to public)
I'll Also add that I ONLY have it set to FirstName.FirstName because it seems tog et it to work if I remove one one of the FirstName then It tells me it cannot convert to string
public void Enter_Click(object sender, EventArgs e)
Form2 frm2 = new Form2();
Employee FirstName = new Employee();
if (Directions.Text == "Please Enter Employee First Name")
{
FirstName.FirstName = Info.Text;
Directions.Text = "Please Enter Employee Last Name";
}
frm2.FN.Text = FirstName;
public class Employee
{
public string FirstName;
}
© Stack Overflow or respective owner